#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QEvent>
#include <QPushButton>

QT_BEGIN_NAMESPACE
namespace Ui {
class Widget;
}
QT_END_NAMESPACE

// 自定义事件
const QEvent::Type EventType_Complete = static_cast<QEvent::Type>(QEvent::User+1);
class CompleteEvent : public QEvent
{
    // Q_OBJECT
    // QEvent 不是 QObject 类
public:
    CompleteEvent();
};


// 自定义按钮类型
class WorkerBtn : public QPushButton
{
    Q_OBJECT
public:
    WorkerBtn(QWidget* parent);
    void mousePressEvent(QMouseEvent* event) override;
    bool event(QEvent* event) override;
};

class Widget : public QWidget
{
    Q_OBJECT
protected:


public:
    Widget(QWidget *parent = nullptr);
    ~Widget();

    WorkerBtn* btn;

private:
    Ui::Widget *ui;
};
#endif // WIDGET_H
